﻿namespace RIFF.Chunk
{
    /// <summary>
    /// LIST chunk。除 RIFF Chunk 外，可以有 subchunk 的 Chunk。
    /// </summary>
    public class List : ListBase
    {
        /// <summary>
        /// 类型
        /// </summary>
        public FourCC ListType => listType;

        /// <summary>
        /// 克隆一个 Chunk，将其解释为 LIST Chunk
        /// </summary>
        /// <exception cref="ChunkIdException"/>
        /// <param name="chunk">克隆源</param>
        public List(Chunk chunk) : base(chunk)
        {
            if (chunk.Id.ToString() != "LIST")
            {
                throw new ChunkIdException("LIST", Id.ToString());
            }
        }
    }
}
